package com.phome.springmvc.dao.impl;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.phome.springmvc.dao.ILoginDao;
import com.phome.springmvc.vo.Student;
@Repository(value="loginDao")
public class LoginDaoImpl implements ILoginDao{
	@Resource
	private JdbcTemplate jdbcTemplate;

	public int findStudent(Student student) {
		String sql="select count(*) from student where name=? and passward=? " ;
		Object[] param={student.getName(),student.getPassward()};
		return this.getJdbcTemplate().queryForObject(sql, param, Integer.class);
	}

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

}
